package com.aiit.mapper;

import com.aiit.pojo.Perms;
import com.aiit.pojo.Role;
import com.aiit.pojo.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: LuTao
 * @Date: 2022/04/28/14:27
 */
@Mapper
public interface UserMapper extends BaseMapper<User> {

    int register(User user);

    User findByUserName(@Param("username") String username);
    //根据用户名查询所有角色
    User findRolesByUserName(String username);

    //根据角色id查询权限集合
    List<Perms> findPermsByRoleId(Integer id);
}
